package com.epfresh.api.entity;

import com.google.gson.GsonBuilder;

import java.util.HashMap;

/**
 * Created by wzh on 2016/3/15.
 */

public class RequestEntity<T> {
    /**
     * cmd : account/favorite/save
     * token : 54de5f132c614801a173851b3c6e51a9
     * clientIdentifierCode : ffffffff-973f-18af-ffff-ffff8794f1f5
     * cityId : 31
     * parameters : {"type":"1","targetId":"7"}
     */
/* {
        "cmd": "account/favorite/save",
                "token": "54de5f132c614801a173851b3c6e51a9",
                "clientIdentifierCode": "ffffffff-973f-18af-ffff-ffff8794f1f5",
                "cityId": 31,
                "parameters": {
            "type": "1", //店铺：1，商品：2
                    "targetId": "7" //店铺ID，或者商品ID
        }
    }*/

    protected String cmd;
    protected String token;
    protected String clientIdentifierCode;
    protected String cityId;
    protected String appDomain;
    protected T parameters;
    protected HashMap<String,Object> deviceInfo;
    protected String appVersion;
    protected String menuCode;

    private String storeId;

    private String merchantId;

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getAppDomain() {
        return appDomain;
    }

    public String getAppVersion() {
        return appVersion;
    }

    public void setAppVersion(String appVersion) {
        this.appVersion = appVersion;
    }

    public HashMap<String, Object> getDeviceInfo() {
        return deviceInfo;
    }

    public void setDeviceInfo(HashMap<String, Object> deviceInfo) {
        this.deviceInfo = deviceInfo;
    }

    public void setAppDomain(String appDomain) {
        this.appDomain = appDomain;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public void setClientIdentifierCode(String clientIdentifierCode) {
        this.clientIdentifierCode = clientIdentifierCode;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public void setParameters(T parameters) {
        this.parameters = parameters;
    }

    public String getCmd() {
        return cmd;
    }

    public String getToken() {
        return token;
    }

    public String getClientIdentifierCode() {
        return clientIdentifierCode;
    }

    public String getCityId() {
        return cityId;
    }

    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    public T getParameters() {
        return parameters;
    }

    @Override
    public String toString() {
        return new GsonBuilder().create().toJson(this);
    }

}
